package com.lujieni.consumer.controller;


import com.lujieni.proxy.cloud.CloudFeign;
import com.lujieni.shared.dto.UserDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private CloudFeign cloudFeign;

    @PostMapping("/register")
    public String register(@RequestBody UserDTO userDTO){
        if(cloudFeign.register(userDTO)){
            return "success";
        }else{
            return "fali";
        }
    }


}
